  
function makeGraph(loc,schoolArray, data, years, graphTitle) {

	
	var yLabel
	var stringArray = graphTitle.split(" ");
	yLabel = stringArray[0];
  
  var chart = new Highcharts.Chart({
      chart: {
         renderTo: loc,
         defaultSeriesType: 'line',
         marginRight: 130,
         marginBottom: 25
      },
      title: {
         text: graphTitle,
         x: -20 //center
      },
       xAxis: {
         categories: years
      },
      yAxis: {
         title: {
            text: yLabel
         },
         plotLines: [{
            value: 0,
            width: 1,
            color: '#808080'
         }]
      },
      tooltip: {
         formatter: function() {
                   return '<b>'+ this.series.name +'</b><br/>'+
               this.x +': '+ this.y + '</b><br/>' + 
               this.point.name;
         }
      },
      legend: {
         layout: 'vertical',
         align: 'right',
         verticalAlign: 'top',
         x: -10,
         y: 100,
         borderWidth: 0
      },
      series: []
   });
   

   
   for (var j=0; j<data.length; j++) {
       
        var dataArray = new Array();
  
        dataArray = [];
       for (var i=0; i< data[j].length; i++) {
            var tempObj = new Object();
           
            
        
            var y = data[j][i].num;
           
            var name = data[j][i].text;
            
            tempObj.name = name;
            tempObj.y = y;
         
            dataArray.push(tempObj);
            
        
       }
   
       
       
         var series = [];   
         series = {
            
            name: schoolArray[j],
            data: dataArray
         
            }
          
            chart.addSeries(series);
       
   }
   
 
 


}
   
     
function makeGraphYears(loc,first, second, firstData, secondData, firstLinear, secondLinear, graphTitle) {
  
  var xAxis = new Array();
  var firstArray = new Array();
  var secondArray = new Array();
 
  
  
  for(var i in firstData) {
	xAxis.push(i);
	firstArray.push(firstData[i]);   
    }
    
    var lastYear = parseInt(xAxis[xAxis.length-1]);
    for (var i=1; i<=10; i++) {
        var newYear = lastYear + i;
        xAxis.push(newYear);
    }
    
    
  
  for(var i in secondData) {
	
	secondArray.push(secondData[i]);   
    }
    
   
  var chart = new Highcharts.Chart({
      chart: {
         renderTo: loc,
         defaultSeriesType: 'line',
         marginRight: 130,
         marginBottom: 25
      },
      title: {
         text: graphTitle,
         x: -20 //center
      },
      xAxis: {
         categories: xAxis
      },
      yAxis: {
         title: {
            text: 'Publications'
         },
         plotLines: [{
            value: 0,
            width: 1,
            color: '#808080'
         }]
      },
      tooltip: {
         formatter: function() {
                   return '<b>'+ this.series.name +'</b><br/>'+
               this.x +': '+ this.y;
         }
      },
      legend: {
         layout: 'vertical',
         align: 'right',
         verticalAlign: 'top',
         x: -10,
         y: 100,
         borderWidth: 0
      },
      series: [{
         name: first,
         type: "scatter",
         data: firstArray
      },
      {
         name: second,
         type: "scatter",
         data: secondArray
      },
      {
         name: "Lin Regression of " + first,
         data: firstLinear
      },
         {
         name: "Lin Regression of " + second,
         data: secondLinear
      }
  

        ]
   });
   
 
   
   }